/** 
 * @Description: 文件描述
 * @Author: 程前
 * @Date: 2024-12-02 16:17:42
 * @LastEditors: 程前
 * @LastEditTime: 2024-12-13 16:21:05
 */
import { defineStore } from "pinia";
import { ICesiumGlobalStore } from "@/types/pinia/cesium-global"
import { Viewer } from "cesium";
import { ICesiumLoader } from "@/types/loader";

export const useCesiumGlobalStore = defineStore("cesium-global-loader", {

    state: (): ICesiumGlobalStore => ({
        viewerInstance: null,
        loader: null,
        sign:false,
        showConfigPanel: false,
        flyType: "fixed",
        moduleType: null // 当前功能模块 后续考虑编辑功能模块再移植走
    }),
    actions: {
        /**
         * 获取当前viewer实例
         */
        getViewer(): Viewer | null {
            return this.viewerInstance
        },
        /**
         * 获取当前loader
         */
        getLoader(): ICesiumLoader | null {
            return this.loader
        },
        /**
         * 获取当前是否显示全局配置面板
         */
        getShowConfigPanel(): boolean {
            return this.showConfigPanel
        },
        /**
         * 获取当前功能模块
         */
        getModuleType(): string | null {
            return this.moduleType
        },
        // 展示当前标会的底部菜单
        getSign(p0: boolean) {
            this.sign = p0
        },
    }
})